import java.awt.Dimension;
import java.awt.TextArea;

import javax.swing.BoxLayout;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * 
 * @author Devin Wolanick
 * @Version 1.0
 * 
 * Debug Console Display
 */
public class LuckyWindow {
	
	private JFrame luckyFrame;
	private static final String NL = System.getProperty("line.separator");
	
	public LuckyWindow(int numPlayers) {
		JFrame luckyFrame = new JFrame("Lucky Lucky");
		luckyFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		luckyFrame.setPreferredSize(new Dimension(330,110+(15*numPlayers)));
		this.luckyFrame = luckyFrame;
		JPanel mainPanel = new JPanel();
		mainPanel.setLayout(new BoxLayout(mainPanel, BoxLayout.Y_AXIS));
		JLabel win1 = new JLabel("Suited 777 pays 200:1");
		JLabel win2 = new JLabel("Suited 678 pays 100:1");
		JLabel win3 = new JLabel("777 pays 50:1");
		JLabel win4 = new JLabel("678 pays 30:1");
		JLabel win5 = new JLabel("Suited 21 pays 15:1");
		JLabel win6 = new JLabel("21 Total pays 3:1");
		JLabel win7 = new JLabel("20 total pays 2:1");
		JLabel win8 = new JLabel("19 Total pays 2:1");
		TextArea resultArea = new TextArea("",10,10,TextArea.SCROLLBARS_NONE);
		resultArea.setEditable(false);
		JPanel leftSide = new JPanel();
		leftSide.setLayout(new BoxLayout(leftSide, BoxLayout.Y_AXIS));
		JPanel rightSide = new JPanel();
		rightSide.setLayout(new BoxLayout(rightSide, BoxLayout.Y_AXIS));
		JPanel spacer = new JPanel();
		spacer.setPreferredSize(new Dimension(50,0));
		JPanel payoutArea = new JPanel();
		leftSide.add(win1);
		leftSide.add(win2);
		leftSide.add(win3);
		leftSide.add(win4);
		rightSide.add(win5);
		rightSide.add(win6);
		rightSide.add(win7);
		rightSide.add(win8);
		payoutArea.add(leftSide);
		payoutArea.add(spacer);
		payoutArea.add(rightSide);
		mainPanel.add(payoutArea);
		mainPanel.add(resultArea);
		luckyFrame.getContentPane().add(mainPanel);
		luckyFrame.pack();
		luckyFrame.setResizable(false);
	}
	
	/**
	 * Switches Visibility
	 */
	public void switchVisible() {
		if (!luckyFrame.isVisible())
			luckyFrame.setVisible(true);
		else
			luckyFrame.setVisible(false);
	}
}